/*
 * SensorPoller.hpp
 *
 *  Created on: 4 dec. 2012
 *      Author: Admin
 */

#ifndef SENSORPOLLER_HPP_
#define SENSORPOLLER_HPP_

#include "Sensor.hpp"
#include "Side.hpp"

class SensorPoller
{
public:
	SensorPoller();
	virtual ~SensorPoller();
	void poll();
	void addSensor(Sensor* sensor);
	void addSensor(Sensor& sensor);
private:
	Sensor* sensors[10];
	bool lastValues[10];
	short sensorCount;

	void pollCollisionSensor(Side side, bool lastValue, bool newValue);
	void pollColorLaneSensor(bool lastValue, bool newValue);
	void pollCrossRoadsSensor(bool lastValue, bool newValue);
	void pollDistanceSensor(bool lastValue, bool newValue);
	void pollEmergencyStopSensor(bool lastValue, bool newValue);
};

#endif /* SENSORPOLLER_HPP_ */
